<iframe id="previewIframe" src="{{preview_url}}{{filename}}" style="width: 100%; height: 500px;"></iframe>
<script>
$(window).on("resize", function(previewIframe){
    $("#previewIframe").css("width", $("#previewIframe").parent().width());
});
</script>